<%@page language="java" contentType="text/html;charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<%@page import="s2jsp.bysj.biz.*"%>
<%@page import="s2jsp.bysj.entity.User"%>
<%@pge import="s2jsp.bysj.entity.*"%>
<%-- 
	页面说明:检验管理员(包括用户和密码)
	创建者:陈世谊
	创建时间:2010-02-26
	修改者:陈世谊
	修改时间:2010-02-27
--%>
<%
	//设置编码
	response.setCharacterEncoding("UTF-8");
	//response.setContentType("text/html;charset=UTF-8");
	//用户名
	String userName = request.getParameter("userName");
	//密码
	String password = request.getParameter("password");

	//验证用户
	if (userName == null || userName.length() == 0) {
		out.print("请输入用户名!");
	} else if (password == null || password.length() == 0) {
		out.print("请输入密码!");
	} else {

		UserBiz userBiz = new UserBiz();
		//验证用户并获取返回信息
		int num = userBiz.validateAdminUser(userName, password);

		if (num == 1) { //管理员账号验证通过		
			//查询出用户对象
			User admin =userBiz.findUserByUserName(userName);
			//用户添加到session中
			session.setAttribute("admin", admin);
		}
		//返回信息
		out.println(num);

	}
%>



